// 城市排名
(function() {
    var myChart = echarts.init(document.querySelector(".line2 .chart3"));

    var option = {
        title: {
            text: '班次占比',
            left: 'center',
            textStyle: {
                color:"rgba(255,255,255,1)",
                fontSize:18
            }
        },
        // tooltip: {
        //     trigger: 'item'
        //   },
          legend: {
            type: 'scroll',
            orient: 'vertical',
            itemWidth:25,
	        itemHeight:20,
            top: 'center',
            left: '65%',
            textStyle: {
                        color:"rgba(255,255,255,1)",
                        fontSize:18
                        },
          },
          series: [
            {
              name: 'Access From',
              type: 'pie',
              left:'-40%',
              radius: ['40%', '70%'],
              avoidLabelOverlap: false,
              itemStyle: {
                borderRadius: 10,
                borderColor: '#fff',
                borderWidth: 0
              },
              label: {
                show: false,
                formatter:'{b}: {d} %',
                position: 'center'
              },
              emphasis: {
                label: {
                  show: true,
                  fontSize: '20',
                  fontWeight: 'bold',
                  color:"rgba(255,255,255,1)",
                }
              },
              labelLine: {
                show: false
              },
              data: [
                { value: 9, name: '0-2' },
                { value: 68, name: '2-4' },
                { value: 168, name: '>4' },
              ]
            }
          ]
          
    };
    
    myChart.setOption(option);
    // 4 让图表跟随屏幕自动的去适应
    window.addEventListener('resize',function() {
        myChart.resize();
    });

})();
(function() {
    var myChart = echarts.init(document.querySelector(".line2 .chart2"));

    var option = {
        title: {
            text: '票价占比',
            left: 'center',
            textStyle: {
                color:"rgba(255,255,255,1)",
                fontSize:18
            }
        },
        // tooltip: {
        //     trigger: 'item'
        //   },
          legend: {
            type: 'scroll',
            orient: 'vertical',
            itemWidth:25,
	        itemHeight:20,
            top: 'center',
            left: '65%',
            textStyle: {
                        color:"rgba(255,255,255,1)",
                        fontSize:18
                        },
          },
          series: [
            {
              name: 'Access From',
              type: 'pie',
              left:'-40%',
              radius: ['40%', '70%'],
              avoidLabelOverlap: false,
              itemStyle: {
                borderRadius: 10,
                borderColor: '#fff',
                borderWidth: 0
              },
              label: {
                show: false,
                formatter:'{b}: {d} %',
                position: 'center'
              },
              emphasis: {
                label: {
                  show: true,
                  fontSize: '20',
                  fontWeight: 'bold',
                  color:"rgba(255,255,255,1)",
                }
              },
              labelLine: {
                show: false
              },
              data: [
                { value: 37, name: '0-2' },
                { value: 27, name: '2-4' },
                { value: 83, name: '4-6' },
                { value: 94, name: '6-8' },
              ]
            }
          ]
          
    };
    
    myChart.setOption(option);
    // 4 让图表跟随屏幕自动的去适应
    window.addEventListener('resize',function() {
        myChart.resize();
    });

})();


$(function() {
   	
	legend = null;
	xAxis=[
	  {
		type: 'category',
		data: ['9:00', '11:00', '13:00', '15:00', '17:00'],
		axisPointer: {
		  type: 'shadow'
		},
		axisPointer: {
			type: 'shadow'
		  },
		  axisLabel:{
			  color:"rgba(255,255,255,.6)",
			  fontSize: '12'
		  },
		  axisLine:{
			  show: false
		  }
	  }
	];
	yAxis=[
	   {
		type: 'value',
		name: '人次',
		axisLabel:{
			color:"rgba(255,255,255,.6)",
			fontSize: '12'
		},
		axisLine:{
			lineStyle:{
				color:"rgba(255,255,255,.1)",
			}
		},
		splitLine:{
			lineStyle:{
				color:"rgba(255,255,255,.1)",
			}
		}
	  }
	];
	series=[
	  {
		name: '实时客流',
		type: 'bar',
		barWidth:"50%",
		itemStyle:{
			normal:{
				barBorderRadius: 5,
				color: new echarts.graphic.LinearGradient(0,0,0,1,[{offset: 1,color: '#33cabb'},{offset: 0,color: '#3EACE5'}])
				// color:"#2f89cf",
			},
		},
		data: [
		  453, 789, 345,778, 1755
		]
	  }
	];
	
	buidEcharts.initEvent($("#yunyinglc"),
	document.querySelector(".line .chart"),
	series,
	legend,
	xAxis,
	yAxis
	);

    
    $("#yunyinglc").trigger("click");

    legend = null;
	xAxis=[
	  {
		type: 'category',
		data: ['9:00', '11:00', '13:00', '15:00', '17:00'],
		axisPointer: {
		  type: 'shadow'
		},
		axisPointer: {
			type: 'shadow'
		  },
		  axisLabel:{
			  color:"rgba(255,255,255,.6)",
			  fontSize: '12'
		  },
		  axisLine:{
			  show: false
		  }
	  }
	];
	yAxis=[
	   {
		type: 'value',
		name: '万公里',
		axisLabel:{
			color:"rgba(255,255,255,.6)",
			fontSize: '12'
		},
		axisLine:{
			lineStyle:{
				color:"rgba(255,255,255,.1)",
			}
		},
		splitLine:{
			lineStyle:{
				color:"rgba(255,255,255,.1)",
			}
		}
	  }
	];
	series=[
	  {
		name: '运营里程',
		type: 'bar',
		barWidth:"50%",
		itemStyle:{
			normal:{
				barBorderRadius: 5,
				color: new echarts.graphic.LinearGradient(0,0,0,1,[{offset: 1,color: '#33cabb'},{offset: 0,color: '#3EACE5'}])
				// color:"#2f89cf",
			},
		},
		data: [
		  1, 2, 1,1, 3
		]
	  }
	];
	
	buidEcharts.initEvent($("#yunyingcl"),
	document.querySelector(".line .chart"),
	series,
	legend,
	xAxis,
	yAxis
	);

    legend = null;
	xAxis=[
	  {
		type: 'category',
		data: ['9:00', '11:00', '13:00', '15:00', '17:00'],
		axisPointer: {
		  type: 'shadow'
		},
		axisPointer: {
			type: 'shadow'
		  },
		  axisLabel:{
			  color:"rgba(255,255,255,.6)",
			  fontSize: '12'
		  },
		  axisLine:{
			  show: false
		  }
	  }
	];
	yAxis=[
	   {
		type: 'value',
		name: '万公里',
		axisLabel:{
			color:"rgba(255,255,255,.6)",
			fontSize: '12'
		},
		axisLine:{
			lineStyle:{
				color:"rgba(255,255,255,.1)",
			}
		},
		splitLine:{
			lineStyle:{
				color:"rgba(255,255,255,.1)",
			}
		}
	  }
	];
	series=[
	  {
		name: '运营里程',
		type: 'bar',
		barWidth:"50%",
		itemStyle:{
			normal:{
				barBorderRadius: 5,
				color: new echarts.graphic.LinearGradient(0,0,0,1,[{offset: 1,color: '#33cabb'},{offset: 0,color: '#3EACE5'}])
				// color:"#2f89cf",
			},
		},
		data: [
		  58, 65, 64,70, 50
		]
	  }
	];
	
	buidEcharts.initEvent($("#keyunl"),
	document.querySelector(".line .chart"),
	series,
	legend,
	xAxis,
	yAxis
	);

    

});

(function() {
    var myChart = echarts.init(document.querySelector(".bar2 .chart .chartyibiao1"));
    let angle = 0;//角度，用来做简单的动画效果的
    let value = 97;
    var option = {
      title: {
              text: '{a|'+ value +'}{c|%}',
              x: 'center',
              y: 'center',
              textStyle: {
                  rich:{
                      a: {
                          fontSize: 20,
                          color: '#ffffff'
                      },
                      
                      c: {
                          fontSize: 12,
                          color: '#ffffff',
                          // padding: [5,0]
                      }
                  }
              }
          },
          legend: {
              type: "plain",
              orient: "vertical",
              right: 0,
              top: "10%",
              align: "auto",
              data: [{
                  name: '涨价后没吃过',
                  icon: "circle"
              }, {
                  name: '天天吃',
                  icon: "circle"
              }, {
                  name: '三五天吃一次',
                  icon: "circle"
              }, {
                  name: '半个月吃一次',
                  icon: "circle"
              }],
              textStyle: {
                  color: "white",
                  fontSize: 16,
                  padding: [10, 1, 10, 0]
              },
              selectedMode:false
          },
          series: [ {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,
                              startAngle: (0+angle) * Math.PI / 180,
                              endAngle: (90+angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,
                              startAngle: (180+angle) * Math.PI / 180,
                              endAngle: (270+angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
                              startAngle: (270+-angle) * Math.PI / 180,
                              endAngle: (40+-angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
                              startAngle: (90+-angle) * Math.PI / 180,
                              endAngle: (220+-angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      let x0 = api.getWidth() / 2;
                      let y0 = api.getHeight() / 2;
                      let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;
                      let point = getCirlPoint(x0, y0, r, (90+-angle))
                      return {
                          type: 'circle',
                          shape: {
                              cx: point.x,
                              cy: point.y,
                              r: 4
                          },
                          style: {
                              stroke: "#0CD3DB",//粉
                              fill: "#0CD3DB"
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",  //绿点
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      let x0 = api.getWidth() / 2;
                      let y0 = api.getHeight() / 2;
                      let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;
                      let point = getCirlPoint(x0, y0, r, (270+-angle))
                      return {
                          type: 'circle',
                          shape: {
                              cx: point.x,
                              cy: point.y,
                              r: 4
                          },
                          style: {
                              stroke: "#0CD3DB",      //绿
                              fill: "#0CD3DB"
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: '吃猪肉频率',
                  type: 'pie',
                  radius: ['58%', '45%'],
                  silent: true,
                  clockwise: true,
                  startAngle: 90,
                  z: 0,
                  zlevel: 0,
                  label: {
                      normal: {
                          position: "center",
      
                      }
                  },
                  data: [{
                          value: value,
                          name: "",
                          itemStyle: {
                              normal: {
                                  color: { // 完成的圆环的颜色
                                      colorStops: [{
                                          offset: 0,
                                          color: '#4FADFD' // 0% 处的颜色
                                      }, {
                                          offset: 1,
                                          color: '#28E8FA' // 100% 处的颜色
                                      }]
                                  },
                              }
                          }
                      },
                      {
                          value: 100-value,
                          name: "",
                          label: {
                              normal: {
                                  show: false
                              }
                          },
                          itemStyle: {
                              normal: {
                                  color: "#173164"
                              }
                          }
                      }
                  ]
              },
              
              {
                  name: "",
                  type: "gauge",
                  radius: "58%",
                  center: ['50%', '50%'],
                  startAngle: 0,
                  endAngle: 359.9,
                  splitNumber: 8,
                  hoverAnimation: true,
                  axisTick: {
                      show: false
                  },
                  splitLine: {
                      length: 60,
                      lineStyle: {
                          width: 5,
                          color: "#061740"
                      }
                  },
                  axisLabel: {
                      show: false
                  },
                  pointer: {
                      show: false
                  },
                  axisLine: {
                      lineStyle: {
                          opacity: 0
                      }
                  },
                  detail: {
                      show: false
                  },
                  data: [{
                      value: 0,
                      name: ""
                  }]
              },
              
          ]
      };
      function getCirlPoint(x0, y0, r, angle) {
          let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
          let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
          return {
              x: x1,
              y: y1
          }
      }
      
      function draw(){
          angle = angle+3
          myChart.setOption(option, true)
        //window.requestAnimationFrame(draw);
      }
      
      setInterval(function() {
          //用setInterval做动画感觉有问题
          draw()
      }, 100);
    myChart.setOption(option);
    // 4 让图表跟随屏幕自动的去适应
    window.addEventListener('resize',function() {
        myChart.resize();
      
    });
  })();
(function() {
  var myChart = echarts.init(document.querySelector(".bar2 .chart .chartyibiao2"));
  let angle = 0;//角度，用来做简单的动画效果的
  let value = 97;
  var option = {
    title: {
            text: '{a|'+ value +'}{c|%}',
            x: 'center',
            y: 'center',
            textStyle: {
                rich:{
                    a: {
                        fontSize: 20,
                        color: '#ffffff'
                    },
                    
                    c: {
                        fontSize: 12,
                        color: '#ffffff',
                        // padding: [5,0]
                    }
                }
            }
        },
        legend: {
            type: "plain",
            orient: "vertical",
            right: 0,
            top: "10%",
            align: "auto",
            data: [{
                name: '涨价后没吃过',
                icon: "circle"
            }, {
                name: '天天吃',
                icon: "circle"
            }, {
                name: '三五天吃一次',
                icon: "circle"
            }, {
                name: '半个月吃一次',
                icon: "circle"
            }],
            textStyle: {
                color: "white",
                fontSize: 16,
                padding: [10, 1, 10, 0]
            },
            selectedMode:false
        },
        series: [ {
                name: "ring5",
                type: 'custom',
                coordinateSystem: "none",
                renderItem: function(params, api) {
                    return {
                        type: 'arc',
                        shape: {
                            cx: api.getWidth() / 2,
                            cy: api.getHeight() / 2,
                            r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,
                            startAngle: (0+angle) * Math.PI / 180,
                            endAngle: (90+angle) * Math.PI / 180
                        },
                        style: {
                            stroke: "#0CD3DB",
                            fill: "transparent",
                            lineWidth: 1.5
                        },
                        silent: true
                    };
                },
                data: [0]
            }, {
                name: "ring5",
                type: 'custom',
                coordinateSystem: "none",
                renderItem: function(params, api) {
                    return {
                        type: 'arc',
                        shape: {
                            cx: api.getWidth() / 2,
                            cy: api.getHeight() / 2,
                            r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,
                            startAngle: (180+angle) * Math.PI / 180,
                            endAngle: (270+angle) * Math.PI / 180
                        },
                        style: {
                            stroke: "#0CD3DB",
                            fill: "transparent",
                            lineWidth: 1.5
                        },
                        silent: true
                    };
                },
                data: [0]
            }, {
                name: "ring5",
                type: 'custom',
                coordinateSystem: "none",
                renderItem: function(params, api) {
                    return {
                        type: 'arc',
                        shape: {
                            cx: api.getWidth() / 2,
                            cy: api.getHeight() / 2,
                            r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
                            startAngle: (270+-angle) * Math.PI / 180,
                            endAngle: (40+-angle) * Math.PI / 180
                        },
                        style: {
                            stroke: "#0CD3DB",
                            fill: "transparent",
                            lineWidth: 1.5
                        },
                        silent: true
                    };
                },
                data: [0]
            }, {
                name: "ring5",
                type: 'custom',
                coordinateSystem: "none",
                renderItem: function(params, api) {
                    return {
                        type: 'arc',
                        shape: {
                            cx: api.getWidth() / 2,
                            cy: api.getHeight() / 2,
                            r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
                            startAngle: (90+-angle) * Math.PI / 180,
                            endAngle: (220+-angle) * Math.PI / 180
                        },
                        style: {
                            stroke: "#0CD3DB",
                            fill: "transparent",
                            lineWidth: 1.5
                        },
                        silent: true
                    };
                },
                data: [0]
            }, {
                name: "ring5",
                type: 'custom',
                coordinateSystem: "none",
                renderItem: function(params, api) {
                    let x0 = api.getWidth() / 2;
                    let y0 = api.getHeight() / 2;
                    let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;
                    let point = getCirlPoint(x0, y0, r, (90+-angle))
                    return {
                        type: 'circle',
                        shape: {
                            cx: point.x,
                            cy: point.y,
                            r: 4
                        },
                        style: {
                            stroke: "#0CD3DB",//粉
                            fill: "#0CD3DB"
                        },
                        silent: true
                    };
                },
                data: [0]
            }, {
                name: "ring5",  //绿点
                type: 'custom',
                coordinateSystem: "none",
                renderItem: function(params, api) {
                    let x0 = api.getWidth() / 2;
                    let y0 = api.getHeight() / 2;
                    let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;
                    let point = getCirlPoint(x0, y0, r, (270+-angle))
                    return {
                        type: 'circle',
                        shape: {
                            cx: point.x,
                            cy: point.y,
                            r: 4
                        },
                        style: {
                            stroke: "#0CD3DB",      //绿
                            fill: "#0CD3DB"
                        },
                        silent: true
                    };
                },
                data: [0]
            }, {
                name: '吃猪肉频率',
                type: 'pie',
                radius: ['58%', '45%'],
                silent: true,
                clockwise: true,
                startAngle: 90,
                z: 0,
                zlevel: 0,
                label: {
                    normal: {
                        position: "center",
    
                    }
                },
                data: [{
                        value: value,
                        name: "",
                        itemStyle: {
                            normal: {
                                color: { // 完成的圆环的颜色
                                    colorStops: [{
                                        offset: 0,
                                        color: '#4FADFD' // 0% 处的颜色
                                    }, {
                                        offset: 1,
                                        color: '#28E8FA' // 100% 处的颜色
                                    }]
                                },
                            }
                        }
                    },
                    {
                        value: 100-value,
                        name: "",
                        label: {
                            normal: {
                                show: false
                            }
                        },
                        itemStyle: {
                            normal: {
                                color: "#173164"
                            }
                        }
                    }
                ]
            },
            
            {
                name: "",
                type: "gauge",
                radius: "58%",
                center: ['50%', '50%'],
                startAngle: 0,
                endAngle: 359.9,
                splitNumber: 8,
                hoverAnimation: true,
                axisTick: {
                    show: false
                },
                splitLine: {
                    length: 60,
                    lineStyle: {
                        width: 5,
                        color: "#061740"
                    }
                },
                axisLabel: {
                    show: false
                },
                pointer: {
                    show: false
                },
                axisLine: {
                    lineStyle: {
                        opacity: 0
                    }
                },
                detail: {
                    show: false
                },
                data: [{
                    value: 0,
                    name: ""
                }]
            },
            
        ]
    };
    function getCirlPoint(x0, y0, r, angle) {
        let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
        let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
        return {
            x: x1,
            y: y1
        }
    }
    
    function draw(){
        angle = angle+3
        myChart.setOption(option, true)
      //window.requestAnimationFrame(draw);
    }
    
    setInterval(function() {
        //用setInterval做动画感觉有问题
        draw()
    }, 100);
  myChart.setOption(option);
  // 4 让图表跟随屏幕自动的去适应
  window.addEventListener('resize',function() {
      myChart.resize();
    
  });
})();
(function() {
    var myChart = echarts.init(document.querySelector(".bar2 .chart .chartyibiao3"));
    let angle = 0;//角度，用来做简单的动画效果的
    let value = 90;
    var option = {
      title: {
              text: '{a|'+ value +'}{c|%}',
              x: 'center',
              y: 'center',
              textStyle: {
                  rich:{
                      a: {
                          fontSize: 20,
                          color: '#ffffff'
                      },
                      
                      c: {
                          fontSize: 12,
                          color: '#ffffff',
                          // padding: [5,0]
                      }
                  }
              }
          },
          legend: {
              type: "plain",
              orient: "vertical",
              right: 0,
              top: "10%",
              align: "auto",
              data: [{
                  name: '涨价后没吃过',
                  icon: "circle"
              }, {
                  name: '天天吃',
                  icon: "circle"
              }, {
                  name: '三五天吃一次',
                  icon: "circle"
              }, {
                  name: '半个月吃一次',
                  icon: "circle"
              }],
              textStyle: {
                  color: "white",
                  fontSize: 16,
                  padding: [10, 1, 10, 0]
              },
              selectedMode:false
          },
          series: [ {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,
                              startAngle: (0+angle) * Math.PI / 180,
                              endAngle: (90+angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,
                              startAngle: (180+angle) * Math.PI / 180,
                              endAngle: (270+angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
                              startAngle: (270+-angle) * Math.PI / 180,
                              endAngle: (40+-angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
                              startAngle: (90+-angle) * Math.PI / 180,
                              endAngle: (220+-angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      let x0 = api.getWidth() / 2;
                      let y0 = api.getHeight() / 2;
                      let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;
                      let point = getCirlPoint(x0, y0, r, (90+-angle))
                      return {
                          type: 'circle',
                          shape: {
                              cx: point.x,
                              cy: point.y,
                              r: 4
                          },
                          style: {
                              stroke: "#0CD3DB",//粉
                              fill: "#0CD3DB"
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",  //绿点
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      let x0 = api.getWidth() / 2;
                      let y0 = api.getHeight() / 2;
                      let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;
                      let point = getCirlPoint(x0, y0, r, (270+-angle))
                      return {
                          type: 'circle',
                          shape: {
                              cx: point.x,
                              cy: point.y,
                              r: 4
                          },
                          style: {
                              stroke: "#0CD3DB",      //绿
                              fill: "#0CD3DB"
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: '吃猪肉频率',
                  type: 'pie',
                  radius: ['58%', '45%'],
                  silent: true,
                  clockwise: true,
                  startAngle: 90,
                  z: 0,
                  zlevel: 0,
                  label: {
                      normal: {
                          position: "center",
      
                      }
                  },
                  data: [{
                          value: value,
                          name: "",
                          itemStyle: {
                              normal: {
                                  color: { // 完成的圆环的颜色
                                      colorStops: [{
                                          offset: 0,
                                          color: '#4FADFD' // 0% 处的颜色
                                      }, {
                                          offset: 1,
                                          color: '#28E8FA' // 100% 处的颜色
                                      }]
                                  },
                              }
                          }
                      },
                      {
                          value: 100-value,
                          name: "",
                          label: {
                              normal: {
                                  show: false
                              }
                          },
                          itemStyle: {
                              normal: {
                                  color: "#173164"
                              }
                          }
                      }
                  ]
              },
              
              {
                  name: "",
                  type: "gauge",
                  radius: "58%",
                  center: ['50%', '50%'],
                  startAngle: 0,
                  endAngle: 359.9,
                  splitNumber: 8,
                  hoverAnimation: true,
                  axisTick: {
                      show: false
                  },
                  splitLine: {
                      length: 60,
                      lineStyle: {
                          width: 5,
                          color: "#061740"
                      }
                  },
                  axisLabel: {
                      show: false
                  },
                  pointer: {
                      show: false
                  },
                  axisLine: {
                      lineStyle: {
                          opacity: 0
                      }
                  },
                  detail: {
                      show: false
                  },
                  data: [{
                      value: 0,
                      name: ""
                  }]
              },
              
          ]
      };
      function getCirlPoint(x0, y0, r, angle) {
          let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
          let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
          return {
              x: x1,
              y: y1
          }
      }
      
      function draw(){
          angle = angle+3
          myChart.setOption(option, true)
        //window.requestAnimationFrame(draw);
      }
      
      setInterval(function() {
          //用setInterval做动画感觉有问题
          draw()
      }, 100);
    myChart.setOption(option);
    // 4 让图表跟随屏幕自动的去适应
    window.addEventListener('resize',function() {
        myChart.resize();
      
    });
  })();
  (function() {
    var myChart = echarts.init(document.querySelector(".bar2 .chart .chartyibiao4"));
    let angle = 0;//角度，用来做简单的动画效果的
    let value = 55;
    var option = {
      title: {
              text: '{a|'+ value +'}{c|%}',
              x: 'center',
              y: 'center',
              textStyle: {
                  rich:{
                      a: {
                          fontSize: 20,
                          color: '#ffffff'
                      },
                      
                      c: {
                          fontSize: 12,
                          color: '#ffffff',
                          // padding: [5,0]
                      }
                  }
              }
          },
          legend: {
              type: "plain",
              orient: "vertical",
              right: 0,
              top: "10%",
              align: "auto",
              data: [{
                  name: '涨价后没吃过',
                  icon: "circle"
              }, {
                  name: '天天吃',
                  icon: "circle"
              }, {
                  name: '三五天吃一次',
                  icon: "circle"
              }, {
                  name: '半个月吃一次',
                  icon: "circle"
              }],
              textStyle: {
                  color: "white",
                  fontSize: 16,
                  padding: [10, 1, 10, 0]
              },
              selectedMode:false
          },
          series: [ {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,
                              startAngle: (0+angle) * Math.PI / 180,
                              endAngle: (90+angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.6,
                              startAngle: (180+angle) * Math.PI / 180,
                              endAngle: (270+angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
                              startAngle: (270+-angle) * Math.PI / 180,
                              endAngle: (40+-angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      return {
                          type: 'arc',
                          shape: {
                              cx: api.getWidth() / 2,
                              cy: api.getHeight() / 2,
                              r: Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65,
                              startAngle: (90+-angle) * Math.PI / 180,
                              endAngle: (220+-angle) * Math.PI / 180
                          },
                          style: {
                              stroke: "#0CD3DB",
                              fill: "transparent",
                              lineWidth: 1.5
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      let x0 = api.getWidth() / 2;
                      let y0 = api.getHeight() / 2;
                      let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;
                      let point = getCirlPoint(x0, y0, r, (90+-angle))
                      return {
                          type: 'circle',
                          shape: {
                              cx: point.x,
                              cy: point.y,
                              r: 4
                          },
                          style: {
                              stroke: "#0CD3DB",//粉
                              fill: "#0CD3DB"
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: "ring5",  //绿点
                  type: 'custom',
                  coordinateSystem: "none",
                  renderItem: function(params, api) {
                      let x0 = api.getWidth() / 2;
                      let y0 = api.getHeight() / 2;
                      let r = Math.min(api.getWidth(), api.getHeight()) / 2 * 0.65;
                      let point = getCirlPoint(x0, y0, r, (270+-angle))
                      return {
                          type: 'circle',
                          shape: {
                              cx: point.x,
                              cy: point.y,
                              r: 4
                          },
                          style: {
                              stroke: "#0CD3DB",      //绿
                              fill: "#0CD3DB"
                          },
                          silent: true
                      };
                  },
                  data: [0]
              }, {
                  name: '吃猪肉频率',
                  type: 'pie',
                  radius: ['58%', '45%'],
                  silent: true,
                  clockwise: true,
                  startAngle: 90,
                  z: 0,
                  zlevel: 0,
                  label: {
                      normal: {
                          position: "center",
      
                      }
                  },
                  data: [{
                          value: value,
                          name: "",
                          itemStyle: {
                              normal: {
                                  color: { // 完成的圆环的颜色
                                      colorStops: [{
                                          offset: 0,
                                          color: '#4FADFD' // 0% 处的颜色
                                      }, {
                                          offset: 1,
                                          color: '#28E8FA' // 100% 处的颜色
                                      }]
                                  },
                              }
                          }
                      },
                      {
                          value: 100-value,
                          name: "",
                          label: {
                              normal: {
                                  show: false
                              }
                          },
                          itemStyle: {
                              normal: {
                                  color: "#173164"
                              }
                          }
                      }
                  ]
              },
              
              {
                  name: "",
                  type: "gauge",
                  radius: "58%",
                  center: ['50%', '50%'],
                  startAngle: 0,
                  endAngle: 359.9,
                  splitNumber: 8,
                  hoverAnimation: true,
                  axisTick: {
                      show: false
                  },
                  splitLine: {
                      length: 60,
                      lineStyle: {
                          width: 5,
                          color: "#061740"
                      }
                  },
                  axisLabel: {
                      show: false
                  },
                  pointer: {
                      show: false
                  },
                  axisLine: {
                      lineStyle: {
                          opacity: 0
                      }
                  },
                  detail: {
                      show: false
                  },
                  data: [{
                      value: 0,
                      name: ""
                  }]
              },
              
          ]
      };
      function getCirlPoint(x0, y0, r, angle) {
          let x1 = x0 + r * Math.cos(angle * Math.PI / 180)
          let y1 = y0 + r * Math.sin(angle * Math.PI / 180)
          return {
              x: x1,
              y: y1
          }
      }
      
      function draw(){
          angle = angle+3
          myChart.setOption(option, true)
        //window.requestAnimationFrame(draw);
      }
      
      setInterval(function() {
          //用setInterval做动画感觉有问题
          draw()
      }, 100);
    myChart.setOption(option);
    // 4 让图表跟随屏幕自动的去适应
    window.addEventListener('resize',function() {
        myChart.resize();
      
    });
  })();
  
$(function() {
	var MapChart = echarts.init(document.getElementById("szMap"));
	// make_city("嵊州市",MapChart);
    const geoJSON = {};
    $.ajax({
      url: 'js/json/xinchangxian.json',
      async: false,
      dataType: 'json',
      success: function (result) {
        console.log(result)
    	geoJSON.xinchangxian=result;
      }
    });
    echarts.registerMap('xinchangxian',{geoJSON:geoJSON['xinchangxian']});
    var data = [
    {"name":"新昌县",value:24.9}
    ];
    
    option = {
        tooltip: {
            trigger: 'item',
            formatter: function (params) {
              if(typeof(params.value)[2] == "undefined"){
                return params.name + ' : ' + params.value + "%";
              }else{
                return params.name + ' : ' + params.value[2] + "%";
              }
            }
        },
        geo: {
            show: true,
            type:'map',
            map: 'xinchangxian',
            zoom:1.4,
            label: {
                normal: {
                    show: false,
                },
                emphasis: {
                    show: false,
                }
            },
            roam: true,
            itemStyle: {
                normal: {
                    areaColor: '#142957',
                    borderColor: '#0692a4',
                },
                emphasis: {
                    areaColor: '#0b1c2d',
                }
            }
        },
        series : [
        {
            name: 'credit_pm2.5',
            type: 'scatter',
            coordinateSystem: 'geo',
            data: convertData(data),
            symbolSize: function (val) {
                return val[2] / 10;
            },
            label: {
                normal: {
                    formatter: '{b}',
                    position: 'right',
                    show: true
                },
                emphasis: {
                    show: true
                }
            },
            itemStyle: {
                normal: {
                    color: '#D4EEFF'
                }
            }
        },
        {
            type: 'map',
            map: 'xinchangxian',
            geoIndex: 0,
            aspectScale: 0.75, //长宽比
            showLegendSymbol: false, // 存在legend时显示
            label: {
                normal: {
                    show: false
                },
                emphasis: {
                    show: false,
                    textStyle: {
                        color: '#fff'
                    }
                }
            },
            roam: true,
            itemStyle: {
                normal: {
                    areaColor: '#031525',
                    borderColor: '#3B5077',
                },
                emphasis: {
                    areaColor: '#2B91B7'
                }
            },
            animation: false,
            data: data,
			markPoint:{
				symbol:function(value,params) {
					if(params.name == "一级站点") {
						return "image://images/cityBus/一级客运站点.png";
					}else if(params.name == "二级站点") {
						return "image://images/cityBus/二级客运站点.png";
					}else if(params.name == "三级站点") {
						return "image://images/cityBus/三级客运站点.png";
					}else if(params.name == "便携客运站点") {
						return "image://images/cityBus/便携客运站点.png";
					}else if(params.name == "招手站"){
						return "image://images/cityBus/招呼站.png";
					}
				},
				data:[{"name":"一级站点","coord":[120.94101689249872,29.47636312625442]},{"name":"二级站点","coord":[121.08464529526479,29.412403603147656]},{"name":"三级站点","coord":[121.06669174491903,29.448170441727097]},{"name":"便携客运站点","coord":[120.96626407267244,29.377478337240674]},{"name":"招手站","coord":[120.88827833835806,29.361488456463984]}],
				symbolSize:25
			}
        }
    ]
    };
    MapChart.setOption(option);
      
    window.addEventListener('resize',function() {
      MapChart.resize();
    });
	
	// var num = 0;
	// var datazuobiao = [];
	// MapChart.on('click', function (params) {
	// 	let componentType = params.componentType;   // geo是地图图层
	// 	console.log(componentType);
	// 	if (componentType == "series") {
	// 		let offsetX = params.event.offsetX;
	// 		let offsetY = params.event.offsetY;
	// 		let zuobiao = MapChart.convertFromPixel({seriesIndex:0}, [offsetX, offsetY]); // 转换成坐标
	// 		num = datazuobiao.length +1;
	// 		name = "";
	// 		if(num == 1){
	// 			name = "一级站点";
	// 		}else if(num == 2) {
	// 			name = "二级站点";
	// 		}else if(num == 3) {
	// 			name = "三级站点";
	// 		}else if(num == 4) {
	// 			name = "便携客运站点";
	// 		}else {
	// 			name = "招手站";
	// 		}
	// 		console.log(zuobiao);
	// 		datazuobiao.push({name:name,coord:zuobiao});
	// 	}
		
	// 	console.log(JSON.stringify(datazuobiao));
	// });


    var myChart = echarts.init(document.querySelector(".day .chartday"));
    var datas = createData();
    let xLabel = ['1.19','1.20', '1.21', '1.22', '1.23', '1.24', '1.25']
    let goToSchool = ["4000", "6000", "2200", "850", "5000", "4000", "4000"]
    var option = {
        tooltip: {
            trigger: 'axis', 
            backgroundColor:'transparent',
            borderWidth:0,
            axisPointer: {
                lineStyle: {
                    color: {
                        type: 'linear',
                        x: 0,
                        y: 0,
                        x2: 0,
                        y2: 1,
                        colorStops: [{
                            offset: 0,
                            color: 'rgba(126,199,255,0)' // 0% 处的颜色
                        }, {
                            offset: 0.5,
                            color: 'rgba(126,199,255,1)' // 100% 处的颜色
                        }, {
                            offset: 1,
                            color: 'rgba(126,199,255,0)' // 100% 处的颜色
                        }],
                        global: false // 缺省为 false
                    }
                },
            },
            formatter: (p) => {
                let dom = `<div style="width: 90px;
        height: 30px;;color:#fff;position: relative;">
        <svg style="position: absolute;top: 50%;
        left: 50%;
        transform: translateX(-50%) translateY(-50%);" class="svg" xmlns="http://www.w3.org/2000/svg" width="100" height="71" viewBox="0 0 84 55">
          <defs>
            <style>
              .cls-1 {
                fill: #07172c;
                fill-opacity: 0.8;
                stroke: #a7d8ff;
                stroke-linejoin: round;
                stroke-opacity: 0.2;
                stroke-width: 1px;
                fill-rule: evenodd;
              }
    
            </style>
          </defs>
          <path id="矩形_419" data-name="矩形 419" class="cls-1" d="M266,595h74v50H266V624.046L261,620l5-3.984V595Z"
            transform="translate(-258.5 -592.5)" />
        </svg>
            <div style="padding: 4px 8px 4px 14px;display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;position: relative;z-index: 1;">
                <div style="margin-bottom: 4px;width:100%;display:${p[0]?'flex':'none'};justify-content:space-between;align-items:center;">
                    <span style="font-size:14px;color:#7ec7ff;">${p[0]?p[0].seriesName:''}</span>
                    <span style="font-size:14px;color:#fff;">${p[0]?p[0].data:''}</span>
                </div>
                <div style="width:100%;height:100%;display:${p[1]?'flex':'none'};justify-content:space-between;align-items:center;">
                    <span style="font-size:14px;color:#7ec7ff;">${p[1]?p[1].seriesName:''}</span>
                    <span style="font-size:14px;color:#fff;">${p[1]?p[1].data:''}</span>
                </div>
            </div>
        </div>`
                return dom
            }
        },
        grid: {
            top: '5%',
            left: '10%',
            right: '5%',
            bottom: '30%',
            // containLabel: true
        },
        
        xAxis: [{
            type: 'category',
            boundaryGap: false,
            axisLine: { //坐标轴轴线相关设置。数学上的x轴
                show: true,
                lineStyle: {
                    color: '#233653'
                },
            },
            axisLabel: { //坐标轴刻度标签的相关设置
                show: true,
                textStyle: {
                    color: '#7ec7ff',
                    padding: 16,
                    fontSize: 14
                },
                formatter: function(data) {
                    return data
                }
            },
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#192a44'
                },
            },
            axisTick: {
                show: false,
            },
            // data: xLabel
            data: datas.xData,
        }],
        yAxis: [{
            name: '人次',
            nameTextStyle: {
                color: "#7ec7ff",
                fontSize: 16,
                padding: 10
            },
            min: 0,
            splitLine: {
                show: true,
                lineStyle: {
                    color: '#192a44'
                },
            },
            axisLine: {
                show: true,
                lineStyle: {
                    color: "#233653"
                }
    
            },
            axisLabel: {
                show: true,
                textStyle: {
                    color: '#7ec7ff',
                    padding: 16
                },
                formatter: function(value) {
                    if (value === 0) {
                        return value
                    }
                    return value
                }
            },
            axisTick: {
                show: false,
            },
        }],
        series: [{
            name: '客流量',
            type: 'line',
            symbol: 'circle', // 默认是空心圆（中间是白色的），改成实心圆
            showAllSymbol: true,
            symbolSize: 0,
            smooth: true,
            lineStyle: {
                normal: {
                    width: 5,
                    color: "rgba(25,163,223,1)", // 线条颜色
                },
                borderColor: 'rgba(0,0,0,.4)',
            },
            itemStyle: {
                color: "rgba(25,163,223,1)",
                borderColor: "#646ace",
                borderWidth: 2
    
            },
            tooltip: {
                show: true
            },
            areaStyle: { //区域填充样式
                normal: {
                    //线性渐变，前4个参数分别是x0,y0,x2,y2(范围0~1);相当于图形包围盒中的百分比。如果最后一个参数是‘true’，则该四个值是绝对像素位置。
                    color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
                            offset: 0,
                            color: "rgba(25,163,223,.3)"
    
    
                        },
                        {
                            offset: 1,
                            color: "rgba(25,163,223, 0)"
                        }
                    ], false),
                    shadowColor: 'rgba(25,163,223, 0.5)', //阴影颜色
                    shadowBlur: 20 //shadowBlur设图形阴影的模糊大小。配合shadowColor,shadowOffsetX/Y, 设置图形的阴影效果。
                }
            },
            // data: goToSchool
            data: datas.yData
        }]
      };
      let len = 0
    setInterval(()=>{
        if(len === datas.xData.length){
            len = 0
        }
        myChart.dispatchAction({
            type: 'showTip',
            seriesIndex: 0,
            dataIndex: len,
        })
        len ++
    }, 1000)
   
    myChart.setOption(option);
    // 4 让图表跟随屏幕自动的去适应
    window.addEventListener('resize',function() {
        myChart.resize();
      
    });
})


function createData() {
    //30天
    var d = new Date();
    var todayTime = d.getTime();
    var xData = [];
    var yData = [];
    var kl = 3821;
    for(var i=0;i<30;i++) {
        todayTime = todayTime-24*60*60*1000;
        d.setTime(todayTime);
        var year = d.getFullYear();
        var month = d.getMonth() + 1;
        var day = d.getDate();
        var w = d.getDay();
        xData.push(year + "-" + getDoubleNum(month) + "-" + getDoubleNum(day));
        
        if(w == 0 || w == 6) {
            yData.push(kl - 389*(w + 1));
        }else {
            yData.push(kl + 250*(w+1));
        }
    }
    
    xData.sort();
    yData.reverse();
    
    //数据
    return {
        xData:xData,
        yData:yData
    }
}

var convertData = function (data) {
	var geoCoordMap = {
		"柯桥区":[120.64691822315731,30.18344328732051],
		"上虞区":[120.76843113697011,30.14201843033888],
		"越城区":[120.66410186753488,30.079420868677747],
		"诸暨市":[120.34129483387062,29.898992602713303],
		"嵊州市":[120.6186879502515,29.65228456557833],
		"新昌县":[120.88626184127358,29.43043144263232]
	}
      var res = [];
      for (var i = 0; i < data.length; i++) {
          var geoCoord = geoCoordMap[data[i].name];
          if (geoCoord) {
              res.push({
                  name: data[i].name,
                  value: geoCoord.concat(data[i].value)
              });
          }
      }
      return res;
  };
  
  
  var cityData = [{"name":"柯桥区",value:25},
  {"name":"越城区",value:25},
  {"name":"上虞区",value:25},
  {"name":"诸暨市",value:25},
  {"name":"嵊州市",value:25},
  {"name":"新昌县",value:25}
  ];
  function make_city(cityname,MapChart){
  	var option =  {
  		"title": [
  			{
  				"textStyle": {
  					"color": "#000", 
  					"fontSize": 18
  				}, 
  				"subtext": "", 
  				"text": "", 
  				"top": "auto", 
  				"subtextStyle": {
  					"color": "#aaa", 
  					"fontSize": 12
  				}, 
  				"left": "auto"
  			}
  		], 
  		"legend": [
  			{
  				"selectedMode": "multiple",
  				"top": "top",
  				"orient": "horizontal",
  				"data": [
  					""
  				],
  				"left": "center",
  				"show": true
  			}
  		],
  		"backgroundColor": "rgba(255,255,255,0)",
  		"series": [
  			{
  				"mapType": cityname,
  				zoom:1.4,
  				"data": cityData,
  				"name": "",
  				"symbol": "circle",
  				"type": "map",
  				"roam": true,
  				itemStyle: {
  				    normal: {
  				        areaColor: '#142957',
  				        borderColor: '#0692a4',
  				    },
  				    emphasis: {
  				        areaColor: '#0b1c2d',
  				    }
  				},
  				label: {
  					color: '#D4EEFF',
  				    normal: {
  				        formatter: '{city|{b}}',
  				        position: 'right',
  				        show: true,
  						rich:{
  							city:{
  								color:"#D4EEFF"
  							}
  						}
  				    },
  				  emphasis: {
  					  show: true
  				  }
  				},
  				markPoint:{
  					symbol:function(value,params) {
  						if(params.name == "一级站点") {
  							return "image://images/cityBus/一级客运站点.png";
						}
  						// }else if(params.name == "二级站点") {
  						// 	return "image://images/cityBus/二级客运站点.png";
  						// }else if(params.name == "三级站点") {
  						// 	return "image://images/cityBus/三级客运站点.png";
  						// }else if(params.name == "便携客运站点") {
  						// 	return "image://images/cityBus/便携客运站点.png";
  						// }else if(params.name == "招手站"){
  						// 	return "image://images/cityBus/招呼站.png";
  						// }
  					},
  					data:[{"name":"一级站点","coord":[120.64691822315731,30.18344328732051]},{"name":"一级站点","coord":[120.76843113697011,30.14201843033888]},{"name":"一级站点","coord":[120.66410186753488,30.079420868677747]},{"name":"一级站点","coord":[120.34129483387062,29.898992602713303]},{"name":"一级站点","coord":[120.6186879502515,29.65228456557833]}],//,{"name":"二级站点","coord":[120.88626184127358,29.43043144263232]},{"name":"二级站点","coord":[121.0605530913889,29.47369740436869]},{"name":"二级站点","coord":[120.90958250150028,29.64031738467258]},{"name":"二级站点","coord":[120.38302654164488,29.654125670333126]},{"name":"二级站点","coord":[120.61255093440249,29.80969902210863]},{"name":"二级站点","coord":[120.70706097847909,29.970795688148307]},{"name":"三级站点","coord":[120.91449211417971,29.92476806927983]},{"name":"三级站点","coord":[121.0360050279925,29.822586755391804]},{"name":"三级站点","coord":[120.64078120730849,30.03615490694155]},{"name":"三级站点","coord":[120.44316929696649,30.0103794403752]},{"name":"三级站点","coord":[120.35970588141831,29.850203326712894]},{"name":"三级站点","coord":[120.83962052082032,29.654125670333173]},{"name":"便携客运站点","coord":[120.82611908595234,29.40465597606608]},{"name":"便携客运站点","coord":[121.11701363720114,29.41202039508504]},{"name":"便携客运站点","coord":[120.94517719342548,29.645840698936915]},{"name":"便携客运站点","coord":[121.00163773923764,29.951464088223606]},{"name":"便携客运站点","coord":[120.36707030043753,29.703835498711186]},{"name":"便携客运站点","coord":[120.37566212262631,30.07389755441376]},{"name":"招手站","coord":[120.64569081998806,30.072056449659023]},{"name":"招手站","coord":[120.58800287100635,29.954225745355753]},{"name":"招手站","coord":[120.39898278285314,30.020505516526363]},{"name":"招手站","coord":[120.84207532716036,29.963431269129448]},{"name":"招手站","coord":[120.37811692896618,29.63939683229542]},{"name":"招手站","coord":[120.6260523692712,29.641237937050214]},{"name":"招手站","coord":[121.02864060897424,29.40557652844362]}],
  					symbolSize:25
  				}
  			}
  		]
  	};
  	MapChart.setOption(option);
  	
  	var num = 0;
  	var datazuobiao = [];
  	MapChart.on('click', function (params) {
  		// let componentType = params.componentType;   // geo是地图图层
  		// console.log(componentType);
  		// if (componentType == "series") {
  		// 	let offsetX = params.event.offsetX;
  		// 	let offsetY = params.event.offsetY;
  		// 	let zuobiao = MapChart.convertFromPixel({seriesIndex:0}, [offsetX, offsetY]); // 转换成坐标
  		// 	num++;
  		// 	name = "";
  		// 	if(num < 6){
  		// 		name = "一级站点";
  		// 	}else if(num <12) {
  		// 		name = "二级站点";
  		// 	}else if(num < 18) {
  		// 		name = "三级站点";
  		// 	}else if(num < 24) {
  		// 		name = "便携客运站点";
  		// 	}else {
  		// 		name = "招手站";
  		// 	}
  		// 	console.log(zuobiao);
  		// 	datazuobiao.push({name:name,coord:zuobiao});
  		// }
  		
  		// console.log(JSON.stringify(datazuobiao));
  		//新昌县
  		if(params.name.indexOf("新昌县") != -1) {
  			console.log("新昌县切换...");
  			window.open("https://datav.aliyuncs.com/share/489d3e1eccbcad035d15febbd50c672c?whatever=true");
  		}
  	});
  	
  	
  }